import { Empty, Modal } from "antd";
import React, { useContext, useEffect } from "react";
import useStore from "../../../core/useStore";
import { LowCodeContext } from "../../../core/Provider";
import { RendererEngine } from "../../../core/Renderer";

const Preview = ({ children,modal, store ,...rest}) => {
  const { setStore } = useStore();
  const {items} = useContext(LowCodeContext);
  // const {modal = []} = items
  useEffect(() => {
    // console.log("变量AA", store);
    // const stores = {};
    // store&&store.forEach((item) => {
    //   stores[item.key] = item.value;
    // });
    // setStore({...stores})
  }, [store]);
  console.log('modalmodal',modal,children,rest);
  return <div className='lowcode-page-container' style={{ minHeight: 100 }}>
    
    {children}
    
    {modal?.map((item,index)=>{
      
      return <RendererEngine item={item}/>
    })}

    </div>;
};
export { Preview };
